package com.moli.iov.notify.enums;

/**
 *
 * Message type enum.
 *
 * @author OAK
 * @version 3.0
 * @since 2019/10/12 11:20 AM.
 *
 */
public enum MessageTypeEnum {

  /**
   * alarm.
   */
  ALARM(1, "报警"),

  /**
   * vehicle control.
   */
  VEHICLE_CONTROL(2, "控车");

  /**
   * Message code.
   */
  private int messageCode;

  /**
   * Message value.
   */
  private String msg;

  MessageTypeEnum(int messageCode, String msg) {
    this.messageCode = messageCode;
    this.msg = msg;
  }

  public int getMessageCode() {
    return messageCode;
  }

  public String getMsg() {
    return msg;
  }

  public static MessageTypeEnum valueOf(int messageCode){
     for(MessageTypeEnum messageType : MessageTypeEnum.values()){
        if(messageType.getMessageCode() == messageCode){
          return messageType;
        }
    }
    return ALARM;
  }

}
